cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

project(openni_grabber)

set( CMAKE_CXX_FLAGS "-std=c++11 -O3" )
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(DEPENDENCIES realsense2 ${PCL_LIBRARIES})

find_package(PCL 1.8 REQUIRED)
find_package(Threads REQUIRED)

include_directories(${PCL_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

add_executable (openni_grabber main.cpp CSerialPort.cpp getAmmo.cpp plane.cpp)
target_link_libraries (openni_grabber ${PCL_LIBRARIES} ${DEPENDENCIES} Threads::Threads)

if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE Release CACHE STRING "set build type to Release" FORCE)
  message(${CMAKE_BUILD_TYPE})
endif()